﻿using DotNetStar.TheKing.Infrastructure;
using DotNetStar.TheKing.Services;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace DotNetStar.TheKing.Web
{
    public class CategoryDropDownViewComponent:ViewComponent
    {
        private ContentService _contentService;

        public CategoryDropDownViewComponent(ContentService contentService)
        {
            _contentService = contentService;
        }

        public async Task<IViewComponentResult> InvokeAsync(Channels channel)
        {
            var list = await _contentService.GetCategoriesAsync();
            return View(list);
        }
    }
}
